<!--
  Generated template for the BadDetailPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

    <ion-navbar>
        <ion-title>故障细节</ion-title>
    </ion-navbar>

</ion-header>


<ion-content>
    <loading-spinner [isReady]="isReady" [isShow]='isLoading' [isError]='isError'></loading-spinner>
    <div *ngIf="badObj">
        <div class="nb-info-list">
            <div class="nb-item">
                <div class="nb-desc">设备编号</div>
                <div class="nb-val">{{badObj?.physicalCode}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">故障类型</div>
                <div class="nb-val">{{badObj?.type | devPipe: 'badType'}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">故障详情</div>
                <div class="nb-val">{{badObj?.content}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">备注</div>
                <div class="nb-val">{{badObj?.description | isNullPipe}}</div>
            </div>
            <div class="nb-item">
                <!-- 处理状态(0-未处理，1-处理中，2-已处理) -->
                <div class="nb-desc">处理状态</div>
                <div class="nb-val">{{badObj?.status | devPipe: 'badStatus'}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">创建时间</div>
                <div class="nb-val">{{badObj?.createTime | dateFormatPipe:"yyyy-MM-dd hh:mm"}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">创建人</div>
                <div class="nb-val">{{badObj?.createRealName | isNullPipe}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">处理时间</div>
                <div class="nb-val">{{badObj?.updateTime | dateFormatPipe:"yyyy-MM-dd hh:mm"}}</div>
            </div>
            <div class="nb-item">
                <div class="nb-desc">处理人</div>
                <div class="nb-val">{{badObj?.updateRealName | isNullPipe}}</div>
            </div>
        </div>
        <div class="bad-cut-line" *ngIf="badObj?.status != 2"></div>
        <div padding *ngIf="badObj?.status != 2" i-power="deviceAlarm_updateStatus">

            <h5 class="text-center">故障处理</h5>
            <ion-list>
                <ion-item>
                    <ion-label>处理类型</ion-label>
                    <ion-select [(ngModel)]="badObj.dealStatus" okText="确定" cancelText="取消">
                        <ion-option value="1">处理中</ion-option>
                        <ion-option value="2">已处理</ion-option>
                    </ion-select>
                </ion-item>
                <ion-item>
                    <!-- <ion-label color="primary">备注</ion-label> -->
                    <ion-textarea [(ngModel)]="badObj.dealDescription" placeholder="请输入备注" rows="5" style="border:1px solid #fff;padding:0 5px;background:#f1f1f1;"></ion-textarea>
                </ion-item>
            </ion-list>
            <button color="primary" ion-button block (click)="deal()">确认</button>

        </div>
    </div>

</ion-content>